// 
//                                  _oo8oo_
//                                 o8888888o
//                                 88" . "88
//                                 (| -_- |)
//                                 0\  =  /0
//                               ___/'==='\___
//                             .' \\|     |// '.
//                            / \\|||  :  |||// \
//                           / _||||| -:- |||||_ \
//                          |   | \\\  -  /// |   |
//                          | \_|  ''\---/''  |_/ |
//                          \  .-\__  '-'  __/-.  /
//                        ___'. .'  /--.--\  '. .'___
//                     ."" '<  '.___\_<|>_/___.'  >' "".
//                    | | :  `- \`.:`\ _ /`:.`/ -`  : | |
//                    \  \ `-.   \_ __\ /__ _/   .-` /  /
//                =====`-.____`.___ \_____/ ___.`____.-`=====
//                                  `=---=`
// 
// 
//               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
//                          佛祖保佑         永不宕机/永无bug
//
require.config({
    baseUrl: Rroot,
    paths: {
        'jquery': 'Jquery/jquery.min',
        'bootstrap': 'bootstrap/js/bootstrap.min',
        'validform': 'validform/js/Validform_v5.3.2_min',
        'layer': 'layer/layer',
        'cxselect': 'cxselect/jquery.cxselect.min', //级联插件
        'tinymce': 'tinymce/tinymce.min', //文本编缉器
        'uploadifive': 'uploadifive/jquery.uploadifive.min', //图片上传
        'datetimepicker': 'bootstrap-datetimepicker/js/bootstrap-datetimepicker.min',
        'bootstrapselect': 'bootstrap-select/js/bootstrap-select.min',
        'Chart': 'Chart/Chart.min', //图表插件
        'migrate': 'jqprint/jquery-migrate-1.1.0', //解决打印版本问题
        'jqprint': 'jqprint/jquery.jqprint-0.3', //打印插件
        'ckeditor': 'ckeditor/ckeditor', //ckeditor编缉器

    },
    shim: {
        'bootstrap': {
            deps: ['jquery']
        },
        'validform': {
            deps: ['jquery']
        },
        'layer': {
            deps: ['jquery']
        },
        'datetimepicker': {
            deps: ['jquery']
        },
        'uploadifive': {
            deps: ['jquery']
        },
        'bootstrapselect': {
            deps: ['jquery']
        },
        'jqprint': {
            deps: ['jquery']
        },
        'migrate': {
            deps: ['jquery']
        },
        'ckeditor': {
            deps: ['jquery']
        },


    }
});
define(['jquery', 'bootstrap', 'validform', 'layer', 'cxselect', 'tinymce', 'uploadifive', 'datetimepicker', 'bootstrapselect', 'Chart', 'jqprint', 'migrate', 'ckeditor'], function($) {

    var index = new AdminContainer();
    index.Main();

    //Config/index
    if (window.romClassification) {
        index.AuthOrder(romClassification);
    };
    ////AccessAuth/node
    if (window.NodeSort) {
        index.AccessAuthOrder(NodeSort);
    };
    if (window.AccessDelUrl) {
        index.AccessDelete(AccessDelUrl);
    };
    //Backup/index
    if (window.Backup) {
        var form = $("#export-form");
        var exports = $("button[data-target='#export']");
        var optimize = $("button[data-target='#optimize'],button[data-target='#repair']");
        index.exports(form, exports, optimize);
    };
    //联动数据
    var linkmodel = $('.linkmodel');
    if (linkmodel) {
        linkmodel.each(function(i) {
            index.cxselect('#' + this.id);
        });
    };
    //关联表模型
    var linktable = $('.linktable');
    if (linktable) {
        linktable.each(function(i) {
            index.linktable('#' + this.id);
        });
    };
    //联动城市
    var linkcity = $('.linkcity');
    if (linkcity) {
        linkcity.each(function(i) {
            index.cxselectcity('#' + this.id);
        });
    };
    //编缉器
    var textarea = $('.textarea');
    if (textarea) {
        textarea.each(function(t) {
            index._textarea('#' + this.id);
        });
    };
    //文件上传
    var uploads = $('.uploads');
    if (uploads) {
        uploads.each(function(v) {
            index._uploads(this.id);
        });
    };
    var datatime = $('.datatime');
    if (datatime) {
        datatime.each(function(v) {
            index._datetimepicker('#' + this.id);
        });
    };
    var AutoFloat = $('.float');
    if (AutoFloat) {
        AutoFloat.each(function(v) {
            index.AutoFloat(this.id);
        });
    };

    //datatable

    // var table = $('.table');
    // if (window.TableDataUrl) {
    //     index._datatable(table);
    // };
    //跟单管理

    if (window.disableds) {

        index._disableds();
    };
    //bootstrap select 
    index._selectpicker();
    //统计图表
    index._chart(window.Bars, window.Doughnut);
    //search
    index._search();
    index._parentshow();
    //自动search
    index._autosearch();
    //print打印
    $('.prints').click(function() {
        $("#prints").jqprint();
    });
    //
    $('[data-toggle="tooltip"]').tooltip();
    //public javascript
    function AdminContainer() {
        this._load = function(close) {
            var indexs = layer.load(1, { shade: [0.8, '#393D49'] });
            window.onload = function() {
                if (close) {
                    layer.close(indexs);
                };
            }


        }

        //全局表单提交验证
        this.Main = function() {
                this.AuthAAjax();
                this.btn_ajax();
                var indexs = layer.load(1, { shade: [0.8, '#393D49'] });

                // ajax submit tpl:Release
                var thisAjaxLoginSub = $('.require');
                //文本编缉器存在，即不ajax提交
                var textarea = $('.textarea');

                if (textarea.length) {
                    var ispost = false;
                } else {
                    var ispost = true;
                }
                var AjaxLoginSubmit = thisAjaxLoginSub.Validform({
                    tiptype: function(msg, o, cssctl) {
                        if (!o.obj.is("form")) {
                            var objtip = o.obj.prev().find(".Validform_checktip");
                            cssctl(objtip, o.type);
                            objtip.text(msg);
                        } else {
                            var objtip = o.obj.find("#msgdemo");
                            cssctl(objtip, o.type);
                            objtip.text(msg);
                        }

                    }
                });

                // alert($('button[type="submit"]').text());
                AjaxLoginSubmit.config({
                    showAllError: true,
                    postonce: true, //指定是否开启二次提交防御。
                    ajaxPost: ispost,
                    ajaxpost: {
                        getStatus: function(data) {
                            alert(data);
                        },
                        // timeout: 1000,
                        error: function(data, obj) {
                            layer.alert('服务器请求超时，新刷新后再操作...');
                        },
                        success: function(data) {

                            if (data.status) {

                                //关闭窗口
                                $('#myModal').modal('hide');

                                layer.msg('加载中...', { icon: 16, time: 2000, shade: [0.8, '#393D49'] }, function() {
                                    if (data.url) {
                                        window.location.href = data.url;
                                    } else {
                                        $('.require')[0].reset();
                                        window.location.reload();
                                    }
                                });


                            } else {
                                layer.alert(data.info, { icon: 5 });
                            }
                        }
                    }
                })
                layer.close(indexs);


            }
            // a ajax点击询问处理
        this.AuthAAjax = function() {
                $('.getajax').click(function() {
                    var gethref = $(this).attr('href');
                    var thistext = $(this).text();
                    //询问框
                    layer.confirm('确定' + thistext + '?', {
                        btn: ['确定', '取消'] //按钮
                    }, function() {
                        var indexs = layer.load(1, { shade: [0.8, '#393D49'] });
                        $.ajax({
                            url: gethref,
                            type: 'GET',
                            timeout: 2000,
                            success: function(ob) {
                                if (ob.status) {
                                    if (ob.url) {
                                        window.location.href = ob.url;
                                    } else {
                                        window.location.reload();
                                    }
                                    // layer.close(indexs);
                                } else {
                                    layer.alert(ob.info);
                                    layer.close(indexs);
                                }

                            },
                            error: function() {
                                layer.alert('网络超时，请刷新后操作...');
                                layer.close(indexs);
                            }

                        });
                    }, function() {
                        layer.msg('操作被取消', function() {});
                    });

                    return false;
                });

            }
            // a ajax点击直接处理
        this.btn_ajax = function() {
                $('.btn_ajax').click(function() {
                    var gethref = $(this).attr('href');
                    $.ajax({
                        url: gethref,
                        type: 'GET',
                        timeout: 2000,
                        success: function(ob) {
                            if (ob.status) {
                                if (ob.url) {
                                    layer.alert(ob.info, {
                                        time: 0 //不自动关闭
                                            ,
                                        btn: ['确定'],
                                        yes: function(index) {
                                            layer.close(index);
                                            window.location.href = ob.url;
                                        }
                                    }, { icon: 6 });

                                } else {
                                    layer.alert(ob.info);
                                    // window.location.reload();
                                }
                                // layer.close(indexs);
                            } else {
                                layer.alert(ob.info);
                                layer.close(indexs);
                            }

                        },
                        error: function() {
                            layer.alert('网络超时，请刷新后操作...');
                            layer.close(indexs);
                        }

                    });
                    return false;
                });
            }
            //修改配置值
        this.AuthOrder = function(geturl) {
                if (!geturl) {
                    return false;
                };
                $('.table tr').find('input').blur(function() {
                    var name = $(this).attr('name');
                    var val = $(this).val();
                    var thisid = $(this).parents('tr').find('.id').text();
                    $.get(geturl, { name: name, val: val, id: thisid }, function(data) {
                        //涓夊厓杩愮畻
                        data.status ? layer.msg(data.content) : console.log(data.content);
                    });

                });

            }
            //是否存在指定变量
        this.isExitsVariable = function(variableName) {
                try {
                    if (typeof(variableName) == "undefined") {
                        return false;
                    } else {
                        return true;
                    }
                } catch (e) {}
                return false;
            }
            //权限order
        this.AccessAuthOrder = function(geturl) {
                $('.auth_parent input').blur(function() {
                    var node_id = $(this).attr('id');
                    var node_val = $(this).val();

                    $.post(geturl, {
                            id: node_id,
                            val: node_val
                        },
                        function(data) {
                            if (data.status) {
                                layer.msg(data.content);

                            };
                        }, 'json');
                });
            }
            //
        this.AccessDelete = function(url) {
                var node_delete = $('.node_delete .label-danger');
                node_delete.mouseover(function() {
                    layer.tips('此操作将清除:' + $(this).prev().text() + '请特别注意!', $(this), { tips: [1, '#D9534F'] });
                });
                node_delete.on('click', function() {
                    var thisid = $(this).attr('id');
                    //询问框
                    layer.confirm('此操作将清除:' + $(this).prev().text() + '您是否确定删除？', {
                        btn: ['删除', '不删除'] //按钮
                    }, function(confirm) {
                        var index = layer.load(1, { shade: [0.8, '#393D49'] });
                        //关闭提示窗口 
                        layer.close(confirm);

                        $.post(url, { 'id': thisid }, function(data) {
                            if (data.status) {
                                if (data.url) {
                                    window.location.href = data.url;
                                } else {
                                    window.location.reload();
                                }
                            } else {
                                layer.close(index);
                                layer.alert(data.info, { icon: 5 });
                            }
                        });
                    }, function() {
                        layer.msg('操作已被取消!', function() {});
                    });


                });
            }
            //数据备份控制
        this.exports = function(form, exports, optimize) {
                var _this = this;
                optimize.click(function() {
                    var zthis = $(this);
                    layer.msg('正在' + zthis.text() + '...', { icon: 16, time: 2000, shade: [0.8, '#393D49'] }, function(index) {
                        var attrhref = zthis.attr('href');
                        $.post(attrhref, form.serialize(), function(data) {
                            if (data.status) {
                                layer.close(index);
                                layer.alert(data.content, { icon: 6 });
                            } else {
                                layer.close(index);
                                layer.alert(data.content, { icon: 5 });
                            }
                        });
                    });


                });

                exports.click(function() {
                    exports.parent().find('button').addClass("disabled");
                    exports.html("正在发送备份请求...");
                    $.post(
                        form.attr("action"),
                        form.serialize(),
                        function(data) {
                            if (data.status) {
                                tables = data.tables;
                                exports.html(data.info + "开始备份，请不要关闭本页面！");
                                _this._backup(data.tab);
                                window.onbeforeunload = function() {
                                    return "正在备份数据库，请不要关闭！"
                                }
                            } else {
                                layer.alert(data.info, { icon: 5 });

                                exports.parent().find('button').removeClass("disabled");
                                exports.html("立即备份");
                                setTimeout(function() {
                                    $('#top-alert').find('button').click();
                                    $(this).removeClass('disabled').prop('disabled', false);
                                }, 1500);
                            }
                        },
                        "json"
                    );
                    return false;
                });
            }
            //备份操作
        this._backup = function(tab, status) {
                var _this = this;
                status && _this._showmsg(tab.id, "开始备份...(0%)");
                $.get(form.attr("action"), tab, function(data) {
                    if (data.status) {
                        _this._showmsg(tab.id, data.info);

                        if (!$.isPlainObject(data.tab)) {
                            exports.parent().children().removeClass("disabled");
                            exports.html("备份完成，点击重新备份");
                            window.onbeforeunload = function() {
                                return null
                            }
                            return;
                        }
                        _this._backup(data.tab, tab.id != data.tab.id);
                    } else {
                        layer.alert(data.info, { icon: 5 });

                        exports.parent().children().removeClass("disabled");
                        exports.html("立即备份");
                        setTimeout(function() {
                            $('#top-alert').find('button').click();
                            $(that).removeClass('disabled').prop('disabled', false);
                        }, 1500);
                    }
                }, "json");

            }
            //提示文字
        this._showmsg = function(id, msg) {
                form.find("input[value=" + tables[id] + "]").closest("tr").find(".types").html(msg);

            }
            //联动数据
        this.cxselect = function(classid) {
                if (classid) {
                    var selects = $(classid);
                    var get_json_data = selects.attr('href');
                }
                selects.cxSelect({
                    url: get_json_data,
                    selects: ['province', 'city', 'area'],
                    nodata: 'none',
                    jsonName: 'name',
                    jsonValue: 'id',
                    jsonSub: '_child',
                    required: true,
                    firstTitle: '请选择', //required为false有效
                });
            }
            //联动城市
        this.cxselectcity = function(classid) {
                if (classid) {
                    var selects = $(classid);
                    var get_json_data = selects.attr('href');
                }
                selects.cxSelect({
                    url: get_json_data,
                    selects: ['province', 'city', 'area'],
                    nodata: 'none',
                    required: true,
                    firstTitle: '请选择', //required为false有效
                });
            }
            //文本编缉器
        this._textarea = function(textareaid) {
                if (textareaid) {
                    var wi = $(textareaid).css('width');
                    var he = $(textareaid).css('height');

                };
                //编缉器切换
                if (window.TEXTAREA == 'ckeditor') {
                    //ckeditor编缉器
                    var s = textareaid;
                    if (s.substr(0, 1) == '#') {
                        s = s.substr(1);
                        CKEDITOR.replace(s);
                    }
                } else if (window.TEXTAREA == 'tinymce') {
                    tinymce.init({
                        selector: textareaid,
                            language: 'zh_CN',
                            height: he,
                            width: wi,
                    })    
                }else{
                    layer.alert('编缉器未配置');
                }

                ;
            }
            //图片上传
        this._uploads = function(id) {
            var classid = '#' + id;
            if (classid) {
                $(classid).uploadifive({
                    'checkScript': Rroot + '/uploadifive/check-exists.php',
                    'buttonText': '选择' + $(classid).attr('title'),
                    // 'width':300,
                    'auto': true,
                    'uploadLimit': 3,
                    'uploadScript': $(classid).attr('href'),
                    'removeCompleted': false, //是否删除已完成从队列中上传的列
                    'simUploadLimit': 2, //可同时上传的文件数
                    'itemTemplate': "<div class='uploadifive-queue-item'><span class='filename'></span> | <span class='fileinfo'></span><div class='close'></div></div>",
                    'onUploadComplete': function(file, data) {
                        var this_obj = $(file.queueItem['0']); //队列对象
                        var obj = jQuery.parseJSON(data);
                        if (obj.status) {
                            var html = "<input type='text' name=" + id + "[alt][] value=" + file.name + ">";
                            html += "<input type='hidden' name=" + id + "[path][] value=" + obj.path + ">";
                        }
                        this_obj.find('.fileinfo').text(obj.info);
                        this_obj.find('.filename').html(html);

                    },
                    'onFallback': function() {
                        alert('哎呀！您的浏览器不支持html5文件上传。');
                    },

                });
            };

            $('.close').click(function(){
                $(this).parents('.uploadifive-queue').remove();
            });

        }
        this._datetimepicker = function(id) {
                //日期
                $.fn.datetimepicker.dates['zh-CN'] = {
                    days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"],
                    daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"],
                    daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"],
                    months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
                    monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
                    today: "今天",
                    suffix: [],
                    meridiem: ["上午", "下午"]
                };
                $(id).datetimepicker({
                    format: 'yyyy-mm-dd h:i:s',
                    language: 'zh-CN',
                    autoclose: true, //选择日期点击后关闭
                    todayBtn: true, //显示当前日期按钮
                    todayHighlight: true, //高亮当前日期

                });
            }
            //数据表格
            //插件地址http://bootstrap-table.wenzhixin.net.cn/getting-started/
            // this._datatable = function(table) {

        //         //var tab=('#table').attr('data-url');
        //         $('#table').bootstrapTable({
        //             url: TableDataUrl,
        //             columns: ColumnNav,
        //             cache: false, //是否禁用ajax缓存
        //             search: true, //启用搜索输入。
        //             searchOnEnterKey: true, //回车搜索
        //             searchText: '', //默认要查找的名字
        //             showHeader: true, //显示表格标题
        //             showFooter: false,
        //             showColumns: true, //显示列下拉列表
        //             showRefresh: true, //显示刷新按钮
        //             showToggle: false, //显示切换表、卡视图
        //             showPaginationSwitch: true, //显示分页按钮开关
        //             // cardView:true,//显示卡视图，适用于手机
        //             //detailView:true,//设置true可显示详细页
        //             // searchAlign:'left',//浮左
        //             // buttonsAlign:'left',//浮左
        //             //行样式格式化功能
        //             rowAttributes: function(a, b) {
        //                 //a 行记录数据。
        //                 //b 行索引
        //                 if (!a.update_time) {
        //                     a.update_time = '未更新';
        //                 };
        //                 // console.log();
        //                 // console.log(b);
        //             },
        //             sortOrder: 'desc',
        //             // url:'http://www.baidu.com'
        //             onDblClickRow: function() {
        //                 alert('额，我被双击了');
        //             },

        //             pagination: true, //显示表格底部的分页
        //             showPaginationSwitch: true, //显示分页开关
        //             pageList: "[10, 25, 50, 100, ALL]",
        //             showexport:true,
        //             sortable:true,
        //             // field: 'name',
        //             // title: 'Item Name',
        //             // sortable: true,
        //             // editable: true,
        //             //  align: 'center'

        //         });


        //     }
        //禁用所有表单
        this._disableds = function() {
                //禁用所有表单
                $('.disabled :input').attr('disabled', 'disabled');
                $('.disabled :text').attr('disabled', 'disabled');
                $('.disabled :radio').attr('disabled', 'disabled');
                $('.disabled :checkbox').attr('disabled', 'disabled');
                $('.disabled :image').attr('disabled', 'disabled');
                $('.disabled :file').attr('disabled', 'disabled');
                $('.disabled :submit').attr('disabled', 'disabled');
                $('.disabled').find('.close').remove();
                $('.label-info').remove();


            }
            //bootstrap select 
        this._selectpicker = function(classid) {
            $('.selectpicker').selectpicker();
            // multiple 多选
        }
        this._chart = function(Bars, Doughnut) {
                //柱状图
                if (window.Bars) {
                    var ctx = document.getElementById("myChart").getContext("2d");
                    new Chart(ctx).PolarArea(Bars);
                };
                //饼状图
                if (window.Doughnut) {
                    var ctx2 = document.getElementById('myChart2').getContext("2d");

                    new Chart(ctx2).Doughnut(Doughnut);
                };

            }
            //
        this._search = function() {
                var _search = $('.search');
                if (_search.length) {
                    _search.find('button').click(function() {
                        var fields = _search.serializeArray();
                        var patha = '';
                        jQuery.each(fields, function(i, field) {
                            if (field.value) {
                                patha += field.name + '=' + field.value + '&';
                            }
                            if (patha) {
                                window.location.href = _search.attr('action') + '?' + patha;
                            } else {
                                layer.msg('日期范围不可为空', function() {});
                                return false;
                            }

                        });

                    });
                };
            }
            //
            //联动数据
        this.linktable = function(classid) {
                var _this = this;
                if (classid) {
                    var linktable = $(classid);
                    var get_json_data = $(this).attr('href');
                }
                linktable.click(function() {
                    var gethref = $(this).attr('href');
                    layer.open({
                        type: 2,
                        shade: 0.5,
                        area: ['100%', '100%'],
                        fix: false, //不固定
                        maxmin: true,
                        content: gethref,
                        closeBtn: 1,
                        shadeClose: true,
                        title: '请选择指定值'

                    });


                });

            }
            //
        this._parentshow = function() {
                var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
                var parentshow = $('.parentshow');
                if (!parentshow.length) {
                    return false;
                };
                parentshow.on('click', function() {
                    //父节点id
                    var field = '#' + $(this).attr('field');
                    var selected = $(this).attr('selected');
                    //要查询的字段
                    var gethref = $(this).attr('href');
                    $.ajax({
                        url: gethref,
                        type: 'POST',
                        timeout: 2000,

                        success: function(ob) {
                            if (ob.status) {
                                //改变父窗口的值

                                parent.$(field).val(ob.field);
                                parent.$(field).next().val(ob.data.id);
                                parent.layer.tips(ob.info, field, { time: 5000 });
                                parent.layer.close(index);

                            } else {
                                alert(ob.info);
                            }
                        },
                        error: function() {
                            layer.alert('网络超时，请刷新后操作...');
                            //layer.close(indexs);
                        }
                    });


                });
            }
            //
            //价格
        this.AutoFloat = function(classid) {
                var re = /^[0-9]+.?[0-9]*$/;
                var _this = this;
                if (classid) {
                    var linktable = $('#' + classid);

                }
                if (linktable.val()) {
                    $.post(linktable.attr('href'), { price: linktable.val() }, function(ob) {
                        if (ob.status) {
                            linktable.next().find('span').text(ob.info);
                        } else {
                            alert(ob.info);
                        }
                    });

                };
                linktable.keyup(function() {
                    var get_url = $(this).attr('href');
                    var val = $(this).val();
                    var zthis = $(this);
                    //是否为数字
                    if (re.test(val)) {
                        $.ajax({
                            url: get_url,
                            type: 'POST',
                            data: { price: val },
                            timeout: 2000,
                            success: function(s) {
                                if (s.status) {
                                    zthis.next().find('span').text(s.info);

                                } else {
                                    alert(s.info);
                                }
                            },
                            error: function(e) {
                                layer.alert('网络超时，请刷新后操作...');
                            }

                        });
                        // 
                    } else {
                        $(this).next().find('span').text('零');
                    }


                });
            }
            //按字段值条件查找
        this._autosearch = function() {
                var autosearch = $('.autosearch');
                if (autosearch.length) {
                    //自动选择第一个值

                    var field = autosearch.next().find('li a').eq(0).text();
                    var value = autosearch.next().find('li a').eq(0).attr('value');
                    autosearch.parent().find('#field').val(value);
                    autosearch.find('.action').text(field);
                    //点击后选择点击后的值
                    autosearch.next().find('li a').click(function() {
                        autosearch.parent().find('#field').val($(this).attr('value'));
                        autosearch.find('.action').text($(this).text());
                    });
                    //提交查找条件
                    $('.autosearchsubmit').click(function() {
                        var action = $(this).parents('.well').find('form').attr('action');
                        var searchfield = $("input[name='searchfield']");
                        var v = searchfield.val();
                        if (v) {
                            var mid = $("input[name='mid']").val();
                            geturl = action + '/searchfield/' + v + '/field/' + $('#field').val() + '/mid/' + mid;
                            // console.log(geturl);
                            $('.search').attr('action', geturl).submit();
                        } else {

                            layer.tips('查找值未填', searchfield, {
                                tips: [1, '#000'] //还可配置颜色
                            });


                        }

                    });
                };
                //
            }
            //


    }
});
